package com.action.library;

import com.bean.library.Student;
import com.dao.DaoManager;
import com.dao.library.StudentDao;

public class SLoginAction {
	public Student studentLogin(String studentId, String password)
	{
		DaoManager dm = DaoManager.getInstance();
		StudentDao studentDao = dm.getDao(StudentDao.class);
		Student student = null;	
		try
		{
			dm.begin();
			student = studentDao.getStudentByStudentIdAndPassword(studentId, password);
			dm.commit();
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		finally 
		{
			dm.end();
		}
		return student;
	}
}
